<template>
	<!-- 配送员中心 -->
	<view class="page">
		<view class="user-box color-base-bg">
			<view class="user-all-msg">
				<view class="user-msg">
					<image :src="$util.img(clerkInfo.clerk_headimg)" mode="aspectFill"></image>
					<view class="user-msg2">
						<text class="user-name">{{clerkInfo.clerk_name}}</text>
					</view>
				</view>
			</view>
		</view>
		<view class="group-box mar-top">
			<view class="group-item" @click="jump('/otherpages/community/clerk_delivery')">
				<image :src="$util.img('upload/uniapp/community/community_leader_icon1.png')" mode="widthFix"></image>
				<text class="item-name">配送订单</text>
			</view>
			<view class="group-item" @click="jump('/otherpages/community/clerk_activist')">
				<image :src="$util.img('upload/uniapp/community/community_leader_icon2.png')" mode="widthFix"></image>
				<text class="item-name">售后订单</text>
			</view>
		</view>
		<ns-login ref="login"></ns-login>
		<loading-cover ref="loadingCover"></loading-cover>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				clerkInfo: {},
				
			}
		},
		onLoad() {
			if (uni.getStorageSync('token')) {
				this.getClerkInfo()
			} else {
				this.$refs.login.open('/pages/member/index/index');
			}
		
		},
		methods: {
			// 团长信息
			getClerkInfo() {
				this.$api.sendRequest({
					url: '/api/Communitydelivery/clerkInfo',
					data: {
						site_id: this.$config.siteId,
					},
					success: res => {
						if (res.code == 0) {
							this.clerkInfo = res.data
							if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
						} else {
							if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
						}
					}
				});
			},
			jump(e) {
				this.$util.redirectTo(e)
			},
		}
	}
</script>

<style lang="scss">
	.page {
		
		.group-box {
			border-radius: 15rpx;
			margin: 0 30rpx;
			background-color: white;
			margin-top: 20rpx;
			display: flex;
			align-items: center;
			flex-wrap: wrap;
			padding-top: 10rpx;
		
			.group-item {
				width: 33%;
				display: flex;
				align-items: center;
				flex-direction: column;
				justify-content: center;
				margin: 30rpx 0;
		
				image {
					width: 40rpx;
					margin-bottom: 10rpx;
				}
		
				.item-name {}
			}
		}
		
		.user-box {
			width: 100%;
			height: 410rpx;
		
			.user-all-msg {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0 30rpx;
				padding-top: 90rpx;
		
				.user-msg {
					display: flex;
					align-items: center;
		
					image {
						width: 108rpx;
						height: 108rpx;
						border-radius: 50%;
						border: 4rpx solid white;
					}
		
					.user-msg2 {
						display: flex;
						align-items: flex-start;
						flex-direction: column;
						margin-left: 12rpx;
		
						.user-name {
							display: flex;
							align-items: center;
							color: white;
							font-size: 32rpx;
		
							text {
								font-size: 24rpx;
								background-color: #F6B373;
								padding: 4rpx 20rpx;
								letter-spacing: 2rpx;
								margin-left: 10rpx;
								border-radius: 26rpx;
							}
						}
		
						.user-address {
							padding-top: 10rpx;
							color: white;
							font-size: 24rpx;
						}
					}
				}
		
				.saoma {
					color: white;
					font-size: 56rpx;
				}
		
				image {
					width: 40rpx;
				}
			}
		}
		
		.mar-top {
			margin-top: -120rpx;
		}
		
	}
	
</style>